package com.solution.admin.product.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.solution.admin.product.dao.ProductPropertyRelaDao;
import com.solution.admin.product.entity.ProductPropertyRelaEntity;
import com.solution.common.dao.impl.BaseDaoImpl;

/**
 * 商品属性关联DAO实现
 * @author xu_cc
 * @date 2017-08-31 23:33:40
 */
@Repository
public class ProductPropertyRelaDaoImpl extends BaseDaoImpl<ProductPropertyRelaEntity> implements ProductPropertyRelaDao {

	/**
	 * 保存商品属性关联信息
	 * @param ebProductPropertyRelaEntity
	 * @return
	 * @author xu_cc
	 * @date 2017-08-31 23:33:40
	 */
	@Override
	public long saveProductPropertyRela(ProductPropertyRelaEntity ebProductPropertyRelaEntity) {
		return super.insert(ebProductPropertyRelaEntity);
	}

	/**
	 * 删除商品属性关联
	 * @param ebProductPropertyRelaId
	 * @return
	 * @author xu_cc
	 * @date 2017-08-31 23:33:40
	 */
	public int deleteProductPropertyRelaById( Long productId) {
		return super.deleteById(productId);
	}
	
	/**
	 * 根据条件查询商品属性关联
	 * @param param
	 * @return
	 * @author xu_cc
	 * @date 2017-08-31 23:33:40
	 */
	@Override
	public List<ProductPropertyRelaEntity> listProductPropertyRela(Long productId) {
		return getSessionTemplate().selectList(getStatement("listBy"), productId);
//	    return super.listBy(productId);
	}
}
